package com.baozhun.mall.common.widget.dialog

import android.content.Context
import android.view.View
import com.alibaba.android.arouter.launcher.ARouter
import com.baozhun.mall.common.R
import com.baozhun.mall.common.arouter.RoutePath
import com.baozhun.mall.common.databinding.DialogChooseCustomerServiceBinding
import com.baozhun.mall.common.listener.ViewOnClickListener
import com.baozhun.mall.common.util.CacheUtil
import com.baozhun.mall.common.util.Constants
import com.baozhun.mall.common.util.config.AppConfig
import com.blankj.utilcode.util.IntentUtils


/**
 * @Title：选择客服
 * @Description：
 * @Author：xuefeng.zhu
 * @Since：2022/11/21
 * @Version：1.0.0
 */
class ChooseCustomerServiceDialog(context: Context) : BaseBottomPopupView<DialogChooseCustomerServiceBinding>(context),
    ViewOnClickListener {

    override fun getImplLayoutId(): Int {
        return R.layout.dialog_choose_customer_service
    }

    override fun onCreate() {
        super.onCreate()

    }

    override fun onClick(v: View?) {
        when (v?.id) {
            R.id.tv_cancel -> {
                dismiss()
            }

            R.id.tv_call_phone -> {
                dismiss()
                context.startActivity(IntentUtils.getDialIntent(CacheUtil.getAppConfig().customer_service_phone))
            }

            R.id.tv_link_online_customer_service -> {
                dismiss()
                ARouter.getInstance().build(RoutePath.Me.CHAT).navigation()
            }

        }
    }
}